package com.qidian.mes.sys.service.impl;

import com.auth0.jwt.exceptions.JWTDecodeException;
import com.auth0.jwt.exceptions.SignatureVerificationException;
import com.auth0.jwt.exceptions.TokenExpiredException;
import com.auth0.jwt.interfaces.Claim;
import com.qidian.common.pojo.MESResult;
import com.qidian.common.util.Constant;
import com.qidian.common.util.JSONTools;
import com.qidian.common.util.JWTUtil;
import com.qidian.mes.pojo.User;
import com.qidian.mes.sys.mapper.UserMapper;
import com.qidian.mes.sys.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * @Author 戴着假发的程序员
 * @Company 起点编程
 * @Description
 * @Time 2024/10/14 上午 11:13
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public MESResult get(Long userId) {
        return MESResult.success(userMapper.selectByUserId(userId));
    }

    @Override
    public MESResult update(User user) {
        return MESResult.isSuccess(userMapper.updateById(user));
    }
}
